package com.sz.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import com.sz.test.entity.Person;


@Controller
public class IndexController {
	@GetMapping(value="/index")
	public String index()
	{
		System.out.println("====index=======");
		 
		
		return "index";
	}
	
	@GetMapping(value="/index/info" ,consumes="application/json")
	public ModelAndView info()
	{
		System.out.println("====/index/info=======");
		ModelAndView rs = new  ModelAndView();
		Person p = new Person();
		p.setAge(99);
		p.setJob("运动员");
		p.setName("乔治.保罗");
		p.setSalary("5000000.00$");
		p.setSex("男");
		rs.addObject(p);
		return rs;
	}
}